package com.lyb.mapper;

import com.lyb.pojo.Role;
import com.lyb.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface RoleMapper {
    @Select("select * from role")
    List<Role> queryPage();
    @Update("update role set name=#{role.name} where id=#{role.id}")
    Boolean update(@Param("role") Role role);
    @Delete("delete from role where id=#{id}")
    Boolean del(Long id);
    @Insert("insert into role (name) values (#{role.name})")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    Boolean add(@Param("role") Role role);
}
